package com.jyserver.common.AutoCode.jybaits.element.pc;

import com.jyserver.common.utils.Reg;

public class RegS {

    public static String validID = "var validID = (rule, value, validator) => {\n" +
            "        if (value == '' || value == undefined) {\n" +
            "          validator()\n" +
            "        } else {\n" +
            "          let reg = " + Reg.idreg + "\n" +
            "          if (!reg.test(value)) {\n" +
            "            validator(new Error('身份证号码不正确'))\n" +
            "          }\n" +
            "        }\n" +
            "      };\n";
    public static String validphone=" var validphone = (rule, value, validator) => {\n" +
            "        if (value == '' || value == undefined) {\n" +
            "            validator()\n" +
            "        } else {\n" +
            "            let reg ="+Reg.phonereg+"\n" +
            "            if (value.length == 11 && /^((13|14|15|17|18)[0-9]{1}\\d{8})$/.test(value)) {\n" +
            "            } else {\n" +
            "                validator(new Error('手机号码不正确'))\n" +
            "            }\n" +
            "        }\n" +
            "    };\n";
}
